.tabs {
    --bb-tabs-item-padding: #{$bb-tabs-item-padding};
    --bb-tabs-item-height: #{$bb-tabs-item-height};
    --bb-tabs-item-active-color: #{$bb-tabs-item-active-color};
    --bb-tabs-item-hover-color: #{$bb-tabs-item-hover-color};
    --bb-tabs-border-card-top-item-margin-top: #{$bb-tabs-border-card-top-item-margin-top};
    --bb-tabs-bar-width: #{$bb-tabs-bar-width};
    --bb-tabs-bar-height: #{$bb-tabs-bar-height};
    --bb-tabs-bar-bg: #{$bb-tabs-bar-bg};
    --bb-tabs-body-padding: #{$bb-tabs-body-padding};
    --bb-tabs-header-vertical-min-width: #{$bb-tabs-header-vertical-min-width};
    display: flex;
    flex-flow: column;
}

.tabs,
.tabs-body-content {
    height: 100%;
}

.tabs-header {
    background-color: var(--bs-body-bg);
    border-top-left-radius: var(--bs-border-radius);
    border-top-right-radius: var(--bs-border-radius);
}

.tabs-bottom > .tabs-header {
    border-bottom-left-radius: var(--bs-border-radius);
    border-bottom-right-radius: var(--bs-border-radius);
}

.tabs-left > .tabs-header {
    border-bottom-left-radius: var(--bs-border-radius);
}

.tabs-right > .tabs-header {
    border-bottom-right-radius: var(--bs-border-radius);
}

.tabs-nav-wrap {
    position: relative;
    height: var(--bb-tabs-item-height);

    > .dropdown-toggle {
        &:after {
            display: none;
        }

        .dropdown-item {
            transition: background-color .3s linear;

            &:hover {
                background-color: var(--bb-tabs-item-hover-color);
            }
        }
    }
}

.tabs-nav-scroll {
    position: absolute;
    overflow: hidden;
    left: 0;
    right: 0;
    height: 100%;
    border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0;
}

.extend .tabs-nav-scroll {
    left: var(--bb-tabs-bar-width);
    right: calc(2 * var(--bb-tabs-bar-width));
    border-radius: 0;
}

.tabs-nav {
    white-space: nowrap;
    position: relative;
    display: flex;
    height: 100%;
}

.tabs-nav-wrap {
    > .nav-link-bar {
        position: absolute;
        cursor: pointer;
        font-size: 1rem;
        color: var(--bs-body-color);
        width: var(--bb-tabs-bar-width);
        height: 100%;
        justify-content: center;
        align-items: center;
        border: 1px solid var(--bs-border-color);
        display: none;

        &.left {
            border-width: 0;
            left: 0;
            top: 0;
        }

        &.right {
            border-width: 0;
            right: var(--bb-tabs-bar-width);
            top: 0;
        }

        &.dropdown {
            border-width: 0 0 1px 1px;
            right: 0;
            top: 0;
            border-radius: 0 var(--bs-border-radius) 0 0;
        }
    }
}

.tabs .extend .nav-link-bar {
    display: flex;
}

.tabs .extend .nav-link-bar.left {
    border-width: 0 1px 1px 0;
}

.tabs .extend .nav-link-bar.right {
    border-width: 0 0 1px 1px;
}

.tabs .of .tabs-nav-scroll {
    left: var(--bb-tabs-bar-width);
    right: var(--bb-tabs-bar-width);
    border-radius: 0;
}

.tabs .of .nav-link-bar {
    display: flex;
}

.tabs .of .nav-link-bar.right {
    right: 0;
}

.tabs .tabs-active-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background-color: var(--bb-tabs-bar-bg);
    z-index: 1;
    transition: transform .3s cubic-bezier(.645,.045,.355,1);
    list-style: none;
}

.tabs-item {
    padding: var(--bb-tabs-item-padding);
    height: var(--bb-tabs-item-height);
    display: flex;
    list-style: none;
    font-weight: 500;
    color: var(--bs-body-color);
    cursor: pointer;
    align-items: center;
    position: relative;
    transition: color .3s cubic-bezier(.645,.045,.355,1), padding .3s cubic-bezier(.645,.045,.355,1), transform .3s linear;
}

.tabs-item.active {
    color: var(--bb-tabs-item-active-color);
}

.tabs-item:hover {
    color: var(--bb-tabs-item-hover-color);
}

.tabs-item .tabs-item-text {
    padding: 0 0.25rem;
    pointer-events: none;
}

.tabs-item.is-closeable .tabs-item-text {
    padding-right: 1rem;
}

.tabs-item:hover .tabs-item-close {
    display: flex;
}

.tabs-item .tabs-item-close {
    width: 21px;
    height: 21px;
    display: none;
    position: absolute;
    right: .5rem;
    top: 10px;
    justify-content: center;
    align-items: center;
    transition: all .3s linear;
}

.tabs-item .tabs-item-close:hover {
    background-color: #e4e7ed;
    border-radius: var(--bs-border-radius);
}

.tabs .tabs-body {
    padding: var(--bb-tabs-body-padding);
    flex: 1;
}

.tabs .tabs-content {
    position: relative;
}

/*Card*/
.tabs.tabs-card,
.tabs.tabs-border-card {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}

.tabs.tabs-card > .tabs-header > .tabs-nav-wrap:after,
.tabs.tabs-border-card .tabs-nav-wrap:after {
    content: none;
}

.tabs.tabs-card > .tabs-header .tabs-item,
.tabs.tabs-border-card > .tabs-header .tabs-item {
    height: 100%;
    border: 1px solid var(--bs-border-color);
    border-width: 0 1px 1px 0;
}

.tabs.tabs-card > .tabs-header .tabs-item.active,
.tabs.tabs-border-card > .tabs-header .tabs-item.active {
    background-color: var(--bs-body-bg);
    border-width: 0 1px 0px 0;
}

.tabs .tabs-item-fix {
    height: 100%;
    flex: 1;
    border: 1px solid var(--bs-border-color);
    border-width: 0 0 1px 0;
}

.tabs.tabs-card > .tabs-header .of .nav-link-bar.left,
.tabs.tabs-border-card > .tabs-header .of .nav-link-bar.left {
    border-width: 0 1px 1px 0;
}

.tabs.tabs-card.tabs-right > .tabs-header .of .nav-link-bar.left,
.tabs.tabs-border-card.tabs-right > .tabs-header .of .nav-link-bar.left {
    border-width: 0 0 1px 1px;
}

.tabs.tabs-card > .tabs-header .of .nav-link-bar.right,
.tabs.tabs-border-card > .tabs-header .of .nav-link-bar.right {
    border-width: 0 0 1px 1px;
}

.tabs.tabs-card.tabs-right > .tabs-header .of .nav-link-bar.right,
.tabs.tabs-border-card.tabs-right > .tabs-header .of .nav-link-bar.right {
    border-width: 1px 0 0 1px;
}

.tabs.tabs-vertical > .tabs-header .of .nav-link-bar.left i {
    transform: rotate(90deg);
}

.tabs.tabs-vertical > .tabs-header .of .nav-link-bar.right i {
    transform: rotate(90deg);
}

/*Border-Card*/
.tabs.tabs-border-card {
    background: var(--bs-body-bg);
    box-shadow: 0 2px 4px 0 rgba(0,0,0,.12), 0 0 6px 0 rgba(0,0,0,.04);
}

.tabs.tabs-border-card > .tabs-header .nav-link-bar.left {
    border-top-left-radius: var(--bs-border-radius);
}

.tabs:not(.extend).of .nav-link-bar.right {
    border-radius: 0 var(--bs-border-radius) 0 0;
}

.tabs.tabs-card .tabs-body {
    border-top-width: 0;
    border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
}

.tabs.tabs-border-card .tabs-body {
    border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
}

/*bottom*/
.tabs.tabs-bottom {
    flex-flow: column-reverse;
}

.tabs.tabs-bottom .tabs-nav-wrap:after {
    top: 0;
    bottom: auto;
}

.tabs.tabs-bottom .tabs-nav-scroll {
    border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius);
}

.tabs.tabs-bottom .tabs-active-bar {
    top: 0;
    bottom: auto;
}

.tabs.tabs-card.tabs-bottom > .tabs-header .of .tabs-nav-scroll,
.tabs.tabs-border-card.tabs-bottom > .tabs-header .of .tabs-nav-scroll {
    border-radius: 0;
}

.tabs.tabs-card.tabs-bottom > .tabs-header .nav-link-bar.left,
.tabs.tabs-border-card.tabs-bottom > .tabs-header .nav-link-bar.left {
    border-radius: 0 0 0 var(--bs-border-radius);
    border-width: 1px 1px 0 0;
}

.tabs.tabs-card.tabs-bottom > .tabs-header .nav-link-bar.right,
.tabs.tabs-border-card.tabs-bottom > .tabs-header .nav-link-bar.right {
    border-radius: 0 0 var(--bs-border-radius) 0;
    border-width: 1px 0 0 1px;
}

.tabs.tabs-card.tabs-bottom .tabs-body,
.tabs.tabs-border-card.tabs-bottom .tabs-body {
    border-radius: var(--bs-border-radius) 0 0 var(--bs-border-radius);
}

.tabs.tabs-card.tabs-bottom > .tabs-header .tabs-item,
.tabs.tabs-border-card.tabs-bottom > .tabs-header .tabs-item {
    border-width: 1px 1px 0 0;
}

.tabs.tabs-card.tabs-bottom > .tabs-header .tabs-item.active,
.tabs.tabs-border-card.tabs-bottom > .tabs-header .tabs-item.active {
    border-width: 0 1px 0 0;
}

.tabs.tabs-bottom > .tabs-header .tabs-item-fix {
    border-width: 1px 0 0 0;
}

/*left right*/
.tabs.tabs-left {
    flex-flow: row;
}

.tabs.tabs-right {
    flex-flow: row-reverse;
}

.tabs.tabs-vertical > .tabs-header .tabs-nav-wrap {
    height: 100%;
}

.tabs.tabs-vertical > .tabs-header .tabs-nav-wrap:after {
    top: 0;
    bottom: 0;
    left: auto;
    right: 0;
    height: auto;
    width: 2px;
}

.tabs.tabs-vertical > .tabs-header {
    min-width: var(--bb-tabs-header-vertical-min-width);
}

.tabs.tabs-vertical > .tabs-header .tabs-nav {
    flex-flow: column;
    height: auto;
}

.tabs.tabs-vertical > .tabs-header .tabs-nav-scroll {
    border-radius: 0;
    top: 0;
    bottom: 0;
    height: auto;
}

.tabs.tabs-vertical > .tabs-header .of .tabs-nav-scroll {
    top: var(--bb-tabs-bar-height);
    bottom: var(--bb-tabs-bar-height);
    left: 0;
    right: 0;
}

.tabs.tabs-vertical > .tabs-header .tabs-active-bar {
    bottom: auto;
    left: auto;
    right: 0;
}

.tabs.tabs-vertical > .tabs-header .tabs-item {
    height: var(--bb-tabs-item-height);
    justify-content: flex-end;
}

.tabs.tabs-vertical > .tabs-header .tabs-item:last-child {
    border-width: 0 1px 0 0;
}

.tabs.tabs-vertical.tabs-right > .tabs-header .tabs-nav-wrap:after {
    left: 0;
    right: auto;
}

.tabs.tabs-vertical.tabs-right > .tabs-header .tabs-item {
    justify-content: flex-start;
}

.tabs.tabs-vertical.tabs-card > .tabs-header .tabs-item.active,
.tabs.tabs-vertical.tabs-border-card > .tabs-header .tabs-item.active {
    border-width: 0 0 1px 0;
}

.tabs.tabs-vertical.tabs-card > .tabs-header .tabs-item:last-child.active,
.tabs.tabs-vertical.tabs-border-card > .tabs-header .tabs-item:last-child.active {
    border-width: 0;
}

.tabs.tabs-card.tabs-right > .tabs-header .tabs-item,
.tabs.tabs-border-card.tabs-right > .tabs-header .tabs-item {
    border-width: 0 0 1px 1px;
}

.tabs.tabs-card.tabs-right > .tabs-header .tabs-item.active,
.tabs.tabs-border-card.tabs-right > .tabs-header .tabs-item.active {
    border-width: 0 0 1px 0;
}

.tabs.tabs-card.tabs-right > .tabs-header .tabs-item:last-child.active,
.tabs.tabs-border-card.tabs-right > .tabs-header .tabs-item:last-child.active {
    border-width: 0;
}

.tabs.tabs-vertical.tabs-card > .tabs-header .of .nav-link-bar.right,
.tabs.tabs-vertical.tabs-border-card > .tabs-header .of .nav-link-bar.right {
    border-width: 1px 1px 0 0;
}

.tabs.tabs-vertical.tabs-card.tabs-right > .tabs-header .of .nav-link-bar.right,
.tabs.tabs-vertical.tabs-border-card.tabs-right > .tabs-header .of .nav-link-bar.right {
    border-width: 1px 0 0 1px;
}

.tabs.tabs-vertical.tabs-border-card.tabs-right > .tabs-header .nav-link-bar.left {
    border-top-left-radius: 0;
}

.tabs.tabs-vertical > .tabs-header .tabs-item-fix {
    border-width: 0 1px 0 0;
}

.tabs.tabs-vertical.tabs-right > .tabs-header .tabs-item-fix {
    border-width: 0 0 0 1px;
}

.tabs.tabs-vertical > .tabs-header .nav-link-bar {
    height: var(--bb-tabs-bar-height);
    width: 100%;
}

.tabs.tabs-vertical > .tabs-header .nav-link-bar.left {
}

.tabs.tabs-vertical > .tabs-header .nav-link-bar.right {
    top: auto;
    bottom: 0;
}

.tabs.tabs-right > .tabs-header .tabs-active-bar {
    right: auto;
    left: 0;
}

.is-page .layout-main > .tabs {
    margin: -1rem;
    border: none;
    border-radius: unset;
    min-height: calc(100% + 2rem);
}

.tab-drag-over {
    animation: drag-tab-item 1s linear infinite;
}

.tab-dragging th[draggable] * {
    pointer-events: none;
}

.tab-drag {
    background-color: var(--bs-secondary);
}

@keyframes drag-tab-item {
    50% {
        background-color: var(--bs-primary);
    }
}
